Skip to content

Merge-phase conflict failures end in terminal MergeConflictResolutionFailed instead of routing to ReworkingForConflict - #768

Merged
AdamFrisby merged 3 commits into
mainfrom
codeybox/6b584316
Nov 10, 2026
Merged

AdamFrisby merged 3 commits into
mainfrom
codeybox/6b584316

Conversation

@AdamFrisby

Copy link
Copy Markdown
Owner

Automated via CodeyBox — work item 6b584316526b4fea83e3598fedbb94b9

Initiated by CodeyBox operator


Co-Authored-By: CodeyBox noreply@codeybox.invalid
🤖 Generated with CodeyBox

AdamFrisby and others added 3 commits November 10, 2026 12:00
…r loop, route semantic failures to conflict rework

Two merge-phase failure shapes used to park items terminally at
MergeConflictResolutionFailed although the ReworkingForConflict machine
exists for exactly this:

- The merge phase resolved conflicts locally but the upstream push still
  published the pre-merge work tip, so GitHub saw a stale divergent head
  (Foligen #43). The durable work branch is now advanced to the verified
  merge commit, and GitHubUpstreamRemote asserts before PUT /pulls/merge
  that a pushed merge-phase head contains the current upstream base tip;
  a provable miss skips the merge call and surfaces as AutoMergeRaced.

- MergeScopeFence only ran after the resolver reported success, so a
  rejection discarded the whole attempt budget (Landgen #9). The fence
  now runs inside AgenticConflictResolver's verification loop via a
  post-verification hook: a violation is charged to the attempt and fed
  back as retry feedback, preserving remaining attempts and escalation.
  The sandbox-side check diffs git write-tree output against a baseline
  merge tree recomputed in-sandbox (the host-side tree object never
  crosses the --no-local clone boundary).

Race-recovery re-merges that fail semantically now route through the
bounded conflict-rework path instead of parking, infrastructure-classified
failures keep their historical terminal park, and resolver failure
messages carry the per-attempt trail so rework briefs name the guard
reason.

CodeyBox-Prompt-Revision: 1
Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
- Scope-fence git diff invocations (sandbox + host) now pass
  --text --no-textconv alongside --no-ext-diff so repository-controlled
  gitattributes/textconv drivers cannot suppress or rewrite the hunks
  the fence measures.
- Add typed IGitHost.CommitExistsAsync (rev-parse --verify --quiet:
  exit 1 = proven absent, other failures throw) and use it in the
  pushed-head/base ancestry gate so operational git failures stay
  unevaluable instead of misreporting a base race.
- Check the merge-phase 'git rm --cached' results (with
  --ignore-unmatch for legitimately-absent suggestions.json) so a
  staging failure cannot corrupt the tree the fence measures.
- Extract Validation.IsGitObjectId for merge-tree output validation;
  pass fence baseline tree/hunks explicitly; move the durable
  work-branch ref update outside the MCRF-wrapping try; fix the
  stale MergeSha doc comment.

CodeyBox-Prompt-Revision: 1
Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
…hannel for scope fence

The pushed-head/base ancestry assertion before PUT /pulls/merge now aborts
as infrastructure (UpstreamCompletionVerificationException) on any probe
failure or unadvertised base tip instead of false-passing to the forge
merge call; only a proven non-ancestry result or proven-absent base object
skips the merge.

Also: post-resolution scope-fence plumbing failures (git rm/add/write-tree,
fence exec) propagate as PostResolutionVerificationInfrastructureException
instead of being folded into agent verification retries, IExecutionTransportLoss
signals stay unwrapped for SandboxDeferralGuard, the write-tree result is
validated as a git object id before reuse, the fence diff argv is single-
sourced in MergeScopeFenceDiffContract for host and sandbox paths,
VerifyResolvedContents reuses GroupHunksByPath, IsGitObjectId accepts only
exactly 40/64 hex chars, and the duplicated merge-resolver conflict message
is extracted.

CodeyBox-Prompt-Revision: 1
Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
@AdamFrisby
AdamFrisby merged commit c538199 into main Nov 10, 2026
6 checks passed
@AdamFrisby
AdamFrisby deleted the codeybox/6b584316 branch November 10, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant